<template>
  <div>
    <Banner
      :sightName="sightName"
      :bannerImg="bannerImg"
      :gallaryImgs="gallaryImgs"
    ></Banner>
    <Header></Header>
    <List :list="categoryList"></List>
    <div class="testHeight"></div>
  </div>
</template>

<script>
import axios from 'axios'
import Banner from './component/banner'
import Header from './component/header'
import List from './component/list'
export default {
  name: 'Detail',
  data () {
    return {
      sightName: '',
      bannerImg: '',
      categoryList: [],
      gallaryImgs: []
    }
  },
  components: {
    Banner,
    Header,
    List
  },
  methods: {
    getDtailInfo () {
      axios.get('api/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then(this.getDtailInfoSec)
    },
    getDtailInfoSec (res) {
      const data = res.data.data
      this.sightName = data.sightName
      this.bannerImg = data.bannerImg
      this.gallaryImgs = data.gallaryImgs
      this.categoryList = data.categoryList
    }
  },
  mounted () {
    this.getDtailInfo()
  }
}
</script>

<style lang="stylus" scoped>
  .testHeight
    height: 20rem
</style>
